import { RouteRecordRaw } from 'vue-router';
import { Layout } from '@/router/constant';
import { TableOutlined } from '@vicons/antd';
import { renderIcon } from '@/utils/index';

/**
 * @param name 路由名称, 必须设置,且不能重名
 * @param meta 路由元信息（路由附带扩展信息）
 * @param redirect 重定向地址, 访问这个路由时,自定进行重定向
 * @param meta.disabled 禁用整个菜单
 * @param meta.title 菜单名称
 * @param meta.icon 菜单图标
 * @param meta.keepAlive 缓存该路由
 * @param meta.sort 排序越小越排前
 *
 * */
const routes: Array<RouteRecordRaw> = [
  {
    path: '/flight',
    name: 'Flight',
    redirect: '/flight/flight-list',
    component: Layout,
    meta: {
      title: '信息查询',
      icon: renderIcon(TableOutlined),
      sort: 1,
    },
    children: [
      {
        path: 'flight-list',
        name: 'flight-list',
        meta: {
          title: '航班数据查询',
          permissions: ['flight-list']
        },
        component: () => import('@/views/flight/index.vue'),
      },
      {
        path: 'baggage-list',
        name: 'baggage-list',
        meta: {
          title: '行李信息查询',
          permissions: ['baggage-list']
        },
        component: () => import('@/views/bagage/index.vue'),
      },
      {
        path: 'check-list',
        name: 'check-list',
        meta: {
          title: '值机信息查询',
          permissions: ['check-list']
        },
        component: () => import('@/views/checkIn/index.vue'),
      },
      {
        path: 'airport-list',
        name: 'airport-list',
        meta: {
          title: '机场变更查询',
          permissions: ['airport-list']
        },
        component: () => import('@/views/baseapue/index.vue'),
      },
      {
        path: 'toplace-list',
        name: 'toplace-list',
        meta: {
          title: '到达消息查询',
          permissions: ['toplace-list']
        },
        component: () => import('@/views/dfmearre/index.vue'),
      },
      {
        path: 'changeplane-list',
        name: 'changeplane-list',
        meta: {
          title: '航班更换飞机查询',
          permissions: ['changeplane-list']
        },
        component: () => import('@/views/dfmecfce/index.vue'),
      },
		{//添加了路由1,未在数据库添加
        path: 'fligtbadstatus',
        name: 'fligtbadstatus',
        meta: {
          title: '航班异常状态',
          permissions: ['fligtbadstatus']
        },
        component: () => import('@/views/dfltdlye/index.vue'),
      },
      {//添加了路由2,未在数据库添加
        path: 'gate-list',
        name: 'gate-list',
        meta: {
          title: '登机门信息',
          permissions: ['gate-list']
        },
        component: () => import('@/views/dfltgtls/index.vue'),
      },
      {//添加了路由3,未在数据库添加
        path: 'status-list',
        name: 'status-list',
        meta: {
          title: '航班状态变化信息',
          permissions: ['status-list']
        },
        component: () => import('@/views/dfltonre/index.vue'),
      }
    ],
  },
];

export default routes;
